package com.zbb.order.api;

import com.zbb.base.model.Result;
import com.zbb.order.mapper.OrderDetailsMapper;
import com.zbb.order.model.dto.OrderDetailsDto;
import com.zbb.order.model.po.User;
import com.zbb.order.service.OrderDetailsService;
import com.zbb.order.util.SecurityUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 订单详情表 前端控制器
 * </p>
 *
 * @author itcast
 */
@Slf4j
@RestController
@Api(value = "订单详细信息查询/编辑接口",tags = "订单信息查询/编辑接口")
public class OrderDetailsController {

    @Autowired
    private OrderDetailsService orderDetailsService;

    @Autowired
    private OrderDetailsMapper orderDetailsMapper;

    @ApiOperation("发起订单详情查询接口")
    @GetMapping("detailInfo/{orderId}")
    public Result queryOrderDetail(@PathVariable("orderId") String orderId){
        OrderDetailsDto orderDetailsDto =  orderDetailsService.selectDetails(orderId);
        return Result.ok(orderDetailsDto);
    }


}
